package com.lwb.ztx.news.presenter;

import com.lwb.ztx.bean.NewsDetailBean;
import com.lwb.ztx.news.model.NewsDetailModel;
import com.lwb.ztx.news.model.NewsDetailModelImpl;
import com.lwb.ztx.news.view.NewsDetailView;

/**
 * Created by Administrator on 2016/5/28.
 */
public class NewsDetailPresenterImpl implements NewsDetailPresenter,NewsDetailModelImpl.OnNewsDetailLoadFinish {
    private NewsDetailView newsDetailView;
    private NewsDetailModel newsDetailModel;

    public NewsDetailPresenterImpl(NewsDetailView newsDetailView) {
        this.newsDetailView = newsDetailView;
        newsDetailModel = new NewsDetailModelImpl(this);
    }

    @Override
    public void getNewsDetail(String url) {
        newsDetailModel.loadNewsDetail(url);
    }

    @Override
    public void onSuccess(NewsDetailBean bean) {
        newsDetailView.setNewsDetail(bean);
    }

    @Override
    public void onFailure() {

    }
}
